package com.beimin.evedata.model.ram;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import com.beimin.evedata.model.inv.InvType;

@Embeddable
public class TypeActivityMaterialID implements Serializable {
	private int typeID;
	private int activityID;
	@ManyToOne
	@JoinColumn(name="requiredTypeId")
	private InvType requiredType;

	public int getTypeID() {
		return typeID;
	}

	public void setTypeID(int typeID) {
		this.typeID = typeID;
	}

	public int getActivityID() {
		return activityID;
	}

	public void setActivityID(int activityID) {
		this.activityID = activityID;
	}

	public InvType getRequiredType() {
		return requiredType;
	}

	public void setRequiredType(InvType requiredType) {
		this.requiredType = requiredType;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof TypeActivityMaterialID) {
			return ((TypeActivityMaterialID) obj).hashCode() == this.hashCode();
		}
		return false;
	}

	@Override
	public int hashCode() {
		return (typeID + "" + activityID + "" + requiredType.getTypeID()).hashCode();
	}
}